﻿#ifndef CUSERLOGIN_H
#define CUSERLOGIN_H

#include <QDialog>
#include <QPaintEvent>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include "mainwindow.h"
namespace Ui {
class CUserLogin;
}

class CUserLogin : public QDialog
{
    Q_OBJECT

public:
    explicit CUserLogin(QWidget *parent = nullptr);
    ~CUserLogin();
    static QString getToken();

protected:
    virtual void paintEvent(QPaintEvent *ev) override;
private slots:
    void on_pushButton_login_clicked();
    void ReplyFinshed();
    void SendPostRequst(const QString& strhead,QByteArray arr);
private:
    Ui::CUserLogin *ui;
    MainWindow* m_pMainWnd = nullptr;
    QNetworkAccessManager*  m_pHttpMgr       =       nullptr;
    QNetworkReply* mReply;
    void initUI();
    void setStyleSheet();
    static QString s_token;
};

#endif // CUSERLOGIN_H
